package com.feemanage.common;

import cn.hutool.core.util.ObjectUtil;

import java.math.BigDecimal;

public class SearchUtils {
    public static String processAmount(Object input) {
        if(ObjectUtil.isNotNull(input)){
            try {
                // 转换为BigDecimal并乘以10000
                BigDecimal amount = new BigDecimal(input.toString());
                BigDecimal result = amount.multiply(new BigDecimal("10000"));
                // 去除末尾零并转换为普通字符串格式
                return result.stripTrailingZeros().toPlainString();
            } catch (NumberFormatException e) {
                // 非数字输入返回空字符串
                return "";
            }
        }
        return "";
    }
}
